home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.ada,comp.lang.c++
- Path: alexandria.organon.com!alexandria!jsa
- From: jsa@organon.com (Jon S Anthony)
- Subject: Re: on OO differnces between Ada95 and C++
- In-Reply-To: mab@dst17.wdl.loral.com's message of 29 Feb 1996 23:58:29 GMT
- Message-ID: <JSA.96Mar1152347@organon.com>
- Sender: news@organon.com (news)
- Organization: Organon Motives, Inc.
- References: <4gh204$l7n@qualcomm.com> <DnDuA4.8GC@bton.ac.uk>
- <4gvk2b$sjq@watnews1.watson.ibm.com> <4h5ej5$168@wdl1.wdl.loral.com>
- Date: Fri, 1 Mar 1996 20:23:47 GMT
-
- In article <4h5ej5$168@wdl1.wdl.loral.com> mab@dst17.wdl.loral.com (Mark A Biggar) writes:
-
- > How does this interact with "use type T;"?
-
- Like you expect.
-
- > package A is
- > type T is new integer;
- > function "+"(L,R: T) return T;
- > end A;
- >
- > with A;
- > package B is
- > subtype T is A.T;
- > end B;
- >
- > with B;
- > procedure C is
- > X: B.T;
- > use type B.T;
- > begin
- > X := X + X; --- what "+" operator do I get here if any?
- > end C;
-
- A."+"(L,R: T) return T;
-
- As I recall the important bits are:
-
- 3.2(8)
-
- "A subtype of a given type is a combination of the type, a constraint
- on values of the type, and certain attributes specific to the
- subtype. The given type is called the type of the subtype. Similarly,
- the associated constraint is called the constraint of the subtype. The
- set of values of a subtype consists of the values of its type that
- satisfy its constraint. Such values belong to the subtype."
-
- 3.2.2(8)
-
- "A subtype_mark shall resolve to denote a subtype. The type _determined
- by a subtype_mark is the type of the subtype_ denoted by the
- subtype_mark."
-
- [emphasis mine]
-
- 8.4(8)
- "...
- For each type T or T'Class _determined by a subtype_mark_ of a
- use_type_clause whose scope encloses a place, the declaration of each
- primitive operator of type T is potentially use-visible at this place
- if its declaration is visible at this place."
-
- [emphasis mine]
-
-
- /Jon
-
-
- --
- Jon Anthony
- Organon Motives, Inc.
- 1 Williston Road, Suite 4
- Belmont, MA 02178
-
- 617.484.3383
- jsa@organon.com
-
-